#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
#define pi 3.14159265359
bool isok(double m, vector<int> v, int peo);

int main()
{
    int n;
    int peo{0}, num{0}, r{0}, sum{0};
    double low{0}, high{0}, mid{0};
    vector<int> v;
    cin >> n;
    while(n--)
    {
        v.clear(); 
        cin >> num >> peo;
        peo++;  // 还要算上自己
        for(int i = 0; i < num; i++)
        {
            cin >> r;
            v.push_back(r);
            sum += r*r*pi;
        }
        low = 0;
        high = double(sum)/peo;
        while ((high - low) > 1e-6)
        {
            mid  = (high + low) / 2;
            // cout << mid << endl;
            if(isok(mid, v, peo))
            {
                low = mid;
            }
            else high = mid;
        }
        printf("%.4f\n", mid);
    }
    return 0;
}


bool isok(double m, vector<int> v, int peo)
{
    int p = 0;
    int len1 = v.size();  // 利用.size()方法获取长度
    // printf("%d\n", len1);
    double tmp;
    for(int i = 0; i < len1; i++)
    {
        tmp = v[i]*v[i]*pi;
        p += int(tmp / m);
        
    }
    if (p >= peo) return true;
    else return false;
}